Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving error messages on missing tokens #862

Merged
merged 9 commits into from
Nov 14, 2024
Merged

Improving error messages on missing tokens #862

merged 9 commits into from
Nov 14, 2024

Conversation

pelikhan
Copy link
Member

@pelikhan pelikhan commented Nov 14, 2024


  • πŸ”’ Enhanced Error Messages: The error messages for Azure token retrieval failures have been made more informative by including the specific modelId in the message.
  • πŸ›‘οΈ Improved Configuration Error Reporting: Added specificity to the error messages when configurations for various Azure models are missing, also incorporating the modelId into the messages for clarity.

generated by pr-describe

@pelikhan pelikhan changed the title Tavily Improving error messages on missing tokens Nov 14, 2024
Copy link

The changes made in the nodehost.ts file involve enhancing the error messages by including the modelId in the error strings. This improvement will make debugging easier, as it provides more context about which model ID is causing the issue when an error is thrown related to Azure OpenAI or Azure AI models' configuration or token availability.

The changes look good and provide better error information without affecting the functionality.

LGTM πŸš€

generated by pr-review

else if (provider === MODEL_PROVIDER_AZURE_SERVERLESS_MODELS)
throw new Error("Azure AI Models not configured")
throw new Error(`Azure AI Models not configured for ${modelId}`)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition if (!tok) is checked twice in succession without any code in between that could modify tok. This makes the second check redundant and potentially indicates a logical error in the code flow. Please review the logic to ensure it behaves as intended.

generated by pr-review-commit unreachable_code

@pelikhan pelikhan merged commit 60d5f75 into main Nov 14, 2024
8 checks passed
@pelikhan pelikhan deleted the tavily branch November 14, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant